home *** CD-ROM | disk | FTP | other *** search
/ Front Page News 1991 January to 1991 December / Front-Page News 01-1991-12-1991 - Worldwide News At Your Fingertips (Wayzata Technology)(1992).bin / rmark.bas < prev    next >
BASIC Source File  |  1992-02-16  |  4KB  |  135 lines

  1. 'RMARK BY JACK SPEER - FEBRUARY, 1992.  V1.0
  2. 'BINARY SEARCH THE FAA AIRPLANE DATA BASE BASED ON REGISTRATION MARK.
  3.  
  4.  
  5. DIM CALL$(20)
  6. DIM F$(30)
  7.  
  8.  
  9. PRINT
  10. PRINT "Copyright (c) 1992, Buckmaster Publishing"
  11. PRINT
  12.  
  13.  
  14. CALLS$ = COMMAND$ + " "
  15. ON ERROR GOTO 10000
  16. IF LEN(CALLS$) = 0 GOTO nocalls
  17.  
  18. CALLS$ = RTRIM$(CALLS$)
  19. CALLS$ = LTRIM$(CALLS$)
  20.  
  21.  
  22. CDDRIVE$ = LEFT$(CALLS$, 2) + "\"
  23. NC = 1
  24. FOR N2 = 4 TO LEN(CALLS$)
  25. IF MID$(CALLS$, N2, 2) = "  " GOTO SKIP1
  26. IF MID$(CALLS$, N2, 1) = " " THEN NC = NC + 1: GOTO SKIP1
  27. CALL$(NC) = CALL$(NC) + MID$(CALLS$, N2, 1)
  28. SKIP1:
  29. IF NC > 18 GOTO nocalls
  30. NEXT N2
  31.  
  32.  
  33. OPEN CDDRIVE$ + "PLANES.REG" FOR RANDOM AS #1 LEN = 166
  34. FIELD #1, 5 AS F$(1), 15 AS F$(2), 7 AS F$(3), 5 AS F$(4), 2 AS F$(5), 1 AS F$(6), 2 AS F$(7), 36 AS F$(8), 33 AS F$(9), 18 AS F$(10), 5 AS F$(11), 1 AS F$(12), 7 AS F$(13), 1 AS F$(14), 6 AS F$(15), 6 AS F$(16), 1 AS F$(17), 9 AS F$(18), 1 AS F$(19 _
  35. ), 1 AS F$(20), 2 AS F$(21), 1 AS F$(22), 1 AS F$(23)
  36. FIELD #1, 166 AS R$
  37.  
  38.  
  39. IF LEN(CALL$(1)) = 0 GOTO nocalls
  40.  
  41. PRINT NC, LEN(CALLS$), CDDRIVE$
  42.  
  43. FOR N3 = 1 TO NC
  44. CALL$ = CALL$(N3)
  45. IF LEN(CALL$) > 5 GOTO OUT1
  46. FIVE:
  47. IF LEN(CALL$) < 5 THEN CALL$ = CALL$ + " ": GOTO FIVE
  48.  
  49. OK1:
  50. CALLINPUT$ = CALL$
  51.  
  52. GOSUB MAIN
  53.  
  54. OUT1:
  55. NEXT N3
  56.  
  57. CLOSE
  58. END
  59.  
  60.  
  61.  
  62.  
  63. MAIN:
  64.  
  65. L# = 1
  66. R# = INT(LOF(1) / 166)
  67.  
  68. AGN1:
  69. P# = INT((L# + R#) / 2)
  70. GET #1, P#
  71.  
  72. CALLIN$ = LEFT$(R$, 5)
  73.  
  74. IF CALL$ < CALLIN$ GOTO MINUS1
  75. IF CALL$ = CALLIN$ GOTO PRT1
  76.  
  77. PLUS1:
  78. L# = P# + 1
  79. GOTO CHECK
  80.  
  81. MINUS1:
  82. R# = P# - 1
  83.  
  84. CHECK:
  85. IF L# <= R# GOTO AGN1
  86.  
  87. NOMATCH:
  88. PRINT
  89. PRINT "NO MATCH ON ", CALLINPUT$
  90. PRINT
  91. PRINT
  92. RETURN
  93.  
  94. PRT1:
  95. CLS
  96. PRINT "                      FAA Registration Mark: "; F$(1)
  97. PRINT "                              Serial Number: "; F$(2)
  98. PRINT "                       Model/Series Numbers: "; F$(3)
  99. PRINT "        Engine Manufacturer Code/Model Code: "; F$(4)
  100. PRINT "             Year Aircraft was Manufactured: "; F$(5)
  101. PRINT "                   Aircraft Registrant Type: "; F$(6)
  102. PRINT "                      Number of Registrants: "; F$(7)
  103. PRINT "                          Registrant's Name: "; LEFT$(F$(8), 30)
  104. PRINT "                        Registrant's Street: "; LEFT$(F$(9), 30)
  105. PRINT "                          Registrant's City: "; F$(10)
  106. PRINT "                      Registrant's ZIP Code: "; F$(11)
  107. PRINT "               Registrant's FAA Region Code: "; F$(12)
  108. PRINT "Registrant's State/County, or Country Codes: "; F$(13)
  109. PRINT "     General Aviation Air Carrier Indicator: "; F$(14)
  110. PRINT "                       Last Validation Date: "; F$(15)
  111. PRINT "              Registration Certificate Date: "; F$(16)
  112. PRINT "          Airworthiness Classification Code: "; F$(17)
  113. PRINT "                   Approved Operation Codes: "; F$(18)
  114. PRINT "                         Aircraft Type Code: "; F$(19)
  115. PRINT "                           Engine Type Code: "; F$(20)
  116. PRINT "                          Number of Engines: "; F$(21)
  117. PRINT "                     Aircraft Category Code: "; F$(22)
  118. 'PRINT "                Add/Change/Delete Indicator: "; F$(23)
  119. IF N3 <> NC THEN INPUT "Buckmaster FAA airplane search program.  Press enter for next record "; rr$ ELSE PRINT "Buckmaster FAA Airplane Search Program"
  120. RETURN
  121.  
  122.  
  123. nocalls:
  124. PRINT "BUCKMASTER PUBLISHING 'RMARK' - V1.0, February, 1992."
  125. PRINT "Retrieval of airplane data by entering FAA Airplane Registration Numbers (Marks)"
  126. PRINT
  127. PRINT "     USAGE IS:  RMARK D: MARK MARK MARK"
  128. PRINT "           OR:  RMARK D: MARK > PRN        to print"
  129. PRINT "           OR:  RMARK D: MARK > filename   write to disk"
  130. CLOSE
  131. END
  132.  
  133. 10000 IF ERR = 76 THEN PRINT "Must enter CD-ROM drive Letter, i.e. F: and try again!": PRINT "": GOTO nocalls
  134.  
  135.